package com.imchen.cms.cmscore.dao;

import com.imchen.cms.cmscore.model.User;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserMapper {

    int deleteByPrimaryKey(Integer id);

    int deleteByUserName(String username);

    int deleteByUserNameLogic(@Param("username") String username, @Param("isDelete") Integer isDelete);

    int deleteByPrimaryKeyLogic(@Param("id") Integer id, @Param("isDelete") Integer isDelete);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(Integer id);

    User selectByUserName(String username);

    List<User> selectUsers();

    List<User> selectUsers(@Param("index")Integer index,@Param("pageSize") Integer pageSize);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    int updateByUserNameSelective(User record);

    List<User> selectAllUsers();

}